<?php
/*
Copy this file into your current active theme's directory to customize this template

This template displays Flickr photos based on a tag
*/
global $TanTanFlickrPlugin;
$count = count($photos);
$hasPrev = $page > 1;
$hasNext = ($count > 0) && ($page * $per_page) < $group['photos'];
?>

<?php include($TanTanFlickrPlugin->getDisplayTemplate('/photoalbum-nav.html'));?>

<h2><?php echo $group['name']?> : <?php echo htmlentities($request['tags'], ENT_COMPAT, 'UTF-8')?></h2>
<p><?php echo $group['description']?></p>
<p class="meta">
<?php 
if ($hasPrev || $hasNext) {
    printf(__('Photos %1$d - %2$d tagged with <strong>%3$s</strong>', 'tantan-flickr'), (($page-1) * $per_page) + 1, (($page-1) * $per_page) + $count, htmlentities($request['tags'], ENT_COMPAT, 'UTF-8'));
} else {
    printf(__('Photos tagged with <strong>%s</strong>', 'tantan-flickr'), htmlentities($request['tags'], ENT_COMPAT, 'UTF-8'));
}
?>
</p>
<div id="photos">
<?php if ($count > 0): foreach ($photos as $photo)
echo TanTanFlickrDisplay::photo($photo, array(
	'size' => 'Square',
	'prefix' => '../../'));
?>
<?php else:?>
<?php _e('Sorry, no photos found!', 'tantan-flickr');?>
<?php endif;?>
</div>

<?php include($TanTanFlickrPlugin->getDisplayTemplate('/photoalbum-paging.html'));?>

<div class="flickr-meta-links">
<a href="http://www.flickr.com/photos/tags/<?php echo urlencode($request['tags']);?>/" target="_blank"><?php echo _e('View this tag on Flickr', 'tantan-flickr');?></a>
</div>
